package com.crm.model.mdao;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.crm.model.mpojo.Orderitems;
import com.crm.model.pojo.MOrderItem;

/**
 * 查询交付计划/订单明细Mapper
 * 
 * @author 周远星
 *
 */
@Mapper
public interface OrderitemsMapper {

	/**
	 * 查询交付计划/订单明细用于前台表单展示
	 * 
	 * @return
	 */
	List<Map<String, String>> selectAllOrderItem();
	List<Map<String, String>> selectAllOrderTable(@Param("search") String search);

	/**
	 * 订单视图页数据展示
	 * 
	 * @return
	 */
	List<Map<String, String>> selectOrderItemView(@Param("x") Integer x);

	/**
	 * 根据订单查询金额
	 * 
	 * @param x
	 * @return
	 */
	List<Map<String, BigDecimal>> selectOrderItemMoney(@Param("x") Integer x);

	/**
	 * 根据订单编号查询订单详情信息
	 * 
	 * @param roid
	 * @return
	 */
	public List<Map<String, String>> custByOrderitemsInfo(@Param("x") Integer oid);

	/**
	 * 根据订单ID删除所有的订单详情
	 * 
	 * @param x
	 * @return
	 */
	Integer deleteOrderItemByid(@Param("x") Integer x);

	/**
	 * 添加订单详情
	 * 
	 * @param mOrderItem
	 * @return
	 */
	Integer insertOrderItem(MOrderItem mOrderItem);

	int deleteByPrimaryKey(Integer oiId);

	int insert(Orderitems record);

	int insertSelective(Orderitems record);

	Orderitems selectByPrimaryKey(Integer oiId);

	int updateByPrimaryKeySelective(Orderitems record);

	int updateByPrimaryKey(Orderitems record);

	List<Orderitems> selectByoId(Integer oId);

}
